package com.esoon.controller;

import com.esoon.service.CsrWorkTimeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName CsrWorkTimeController 工作时间管理
 * @Description TODO
 * @Author 2020/9/26 12:17
 * @Version 1.0
 **/
@RestController
@RequestMapping("/v1/CsrWorkTime")
public class CsrWorkTimeController {

    private static final Logger logger;
    static {
        logger = LoggerFactory.getLogger(CsrWorkTimeController.class);
    }

    @Resource
    private CsrWorkTimeService csrWorkTimeService;
/*
 * @Author Jack
 * @Description //TODO 根据时间点在数据库中查询是否为工作时间 参数1 工作日期 参数 2 工作时间
 *                  当工作日期与工作时间两个在数据库中都满足规则时返回1 当工作日期和工作时间有一个不符合条件时返回2
 * @Date 12:22 2020/9/26
 * @Param 
 * @return 
 **/

    @RequestMapping(value = "/selectCountTime",method = RequestMethod.GET)
    public String selectCountTime(@RequestParam String workDate, @RequestParam String workingHours ,@RequestParam String tenantCode,@RequestParam String AD_PAR){
        logger.info("invoking select workTime interface , the url = '/v1/CsrWorkTime/selectCountTime',the requestParam : workDate = [{}] , workingHours = [{}] , tenantCode = [{}] , AD_PAR = [{}}" ,
                workDate , workingHours , tenantCode , AD_PAR);
        return csrWorkTimeService.selectCountTime(workDate,workingHours,tenantCode,AD_PAR);
    }
}
